

if (!localStorage.getItem('pwdmd5')) {
	window.location.href = 'login.html'
}
//返回金额
function FormatCash(currCash) {
	if (currCash == '') {
		return 0;
	} else {
		var intNum = parseInt(currCash);
		var numLen = intNum.toString().length;

		if (numLen <= 4) {
			return intNum.toFixed(0);
		} else if (numLen > 4 && numLen < 9) {
			return (intNum / 10000).toFixed(0);
		} else if (numLen >= 9) {
			return (intNum / 10000 / 10000).toFixed(2);
		}
	}

}

//返回单位
function FormatDW(currCash) {
	if (currCash == '') {
		return '元';
	} else {
		var intNum = parseInt(currCash);

		if (intNum == 0) return '万元';

		var numLen = intNum.toString().length;

		if (numLen <= 4 && numLen > 0) {
			return '元';
		} else if (numLen > 4 && numLen < 9) {
			return '万元';
		} else if (numLen >= 9) {
			return '亿元';
		} else {
			return '万元';
		}
	}



}

//返回金额
function FormatWYCash(currCash) {
	if (currCash == '') {
		return 0
	} else {
		var intNum = parseFloat(currCash);
		return (intNum / 10000).toFixed(2);
	}
}



//获取url中的参数
function getUrlParam(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
	var r = window.location.search.substr(1).match(reg);  //匹配目标参数
	if (r != null) return unescape(r[2]); return null; //返回参数值
}
